package com.cmcc.zysoft.sellmanager.model;
// Generated 2013-2-28 14:16:39 by Hibernate Tools 3.2.2.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.codehaus.jackson.annotate.JsonManagedReference;
import org.hibernate.annotations.GenericGenerator;

/**
 * Company generated by hbm2java
 */
@Entity
@Table(name="tb_c_company")
public class Company  implements java.io.Serializable {


	 private static final long serialVersionUID = -1531324986004682583L;
	 private String companyId;
     private String companyCode;
     private String parentCompanyId;
     private String companyName;
     private String province;
     private String city;
     private String town;
     private String companyAddress;
     private String companyLegal;
     private String companyType;
     private String contactMan;
     private String telephone;
     private String email;
     private String fax;
     private String loginUrl;
     private String indexLogo;
     private String indexPictrue;
     private Date createDate;
     private String createMan;
     private Date modifyDate;
     private String modifyMan;
     private String status;
     private String haveChildCompany;
     private Integer displayOrder;
     private String delFlag;
     private String vitrueFlag;
     private String orgFlag;
     private String orgFrom;
     private String syncFlag;
     private Integer companyUsersLimit;
     private Integer usersLimit;
     private String userLimitFlag;
     private String otherNetFlag;
     private Set<SystemUser> systemUsers = new HashSet<SystemUser>(0);
     private Set<Department> departments = new HashSet<Department>(0);
     private Set<Role> roles = new HashSet<Role>(0);
     @JsonManagedReference
     private Set<Menu> menus = new HashSet<Menu>(0);

    public Company() {
    }

	
    public Company(String companyId) {
        this.companyId = companyId;
    }
    public Company(String companyId, String companyCode, String parentCompanyId, 
    		String companyName, String province, String city, String town, 
    		String companyAddress, String companyLegal, String companyType, 
    		String contactMan, String telephone, String email, String fax, 
    		String loginUrl, String indexLogo, String indexPictrue, Date createDate, 
    		String createMan, Date modifyDate, String modifyMan, String status, 
    		String haveChildCompany, Integer displayOrder, String delFlag,
    		String vitrueFlag, String orgFlag ,String orgFrom, String syncFlag, 
    		int companyUsersLimit, 
    		int usersLimit , String userLimitFlag, String otherNetFlag,Set<SystemUser> systemUsers, 
    		Set<Department> departments, Set<Role> roles,  Set<Menu> menus) {
       this.companyId = companyId;
       this.companyCode = companyCode;
       this.parentCompanyId = parentCompanyId;
       this.companyName = companyName;
       this.province = province;
       this.city = city;
       this.town = town;
       this.companyAddress = companyAddress;
       this.companyLegal = companyLegal;
       this.companyType = companyType;
       this.contactMan = contactMan;
       this.telephone = telephone;
       this.email = email;
       this.fax = fax;
       this.loginUrl = loginUrl;
       this.indexLogo = indexLogo;
       this.indexPictrue = indexPictrue;
       this.createDate = createDate;
       this.createMan = createMan;
       this.modifyDate = modifyDate;
       this.modifyMan = modifyMan;
       this.status = status;
       this.haveChildCompany = haveChildCompany;
       this.displayOrder = displayOrder;
       this.delFlag = delFlag;
       this.vitrueFlag = vitrueFlag;
       this.orgFlag = orgFlag;
       this.orgFrom = orgFrom;
       this.syncFlag = syncFlag;
       this.companyUsersLimit = companyUsersLimit;
       this.userLimitFlag = userLimitFlag;
       this.otherNetFlag = otherNetFlag;
       this.systemUsers = systemUsers;
       this.departments = departments;
       this.roles = roles;
       this.menus = menus;
    }
   
    @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
    @Column(name="company_id", unique=true, nullable=false, length=32)
    public String getCompanyId() {
        return this.companyId;
    }
    
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    
    @Column(name="company_code", length=32)
    public String getCompanyCode() {
        return this.companyCode;
    }
    
    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }
    
    @Column(name="parent_company_id", length=32)
    public String getParentCompanyId() {
        return this.parentCompanyId;
    }
    
    public void setParentCompanyId(String parentCompanyId) {
        this.parentCompanyId = parentCompanyId;
    }
    
    @Column(name="company_name", length=128)
    public String getCompanyName() {
        return this.companyName;
    }
    
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    
    @Column(name="province", length=32)
    public String getProvince() {
        return this.province;
    }
    
    public void setProvince(String province) {
        this.province = province;
    }
    
    @Column(name="city", length=32)
    public String getCity() {
        return this.city;
    }
    
    public void setCity(String city) {
        this.city = city;
    }
    
    @Column(name="town", length=32)
    public String getTown() {
        return this.town;
    }
    
    public void setTown(String town) {
        this.town = town;
    }
    
    @Column(name="company_address", length=512)
    public String getCompanyAddress() {
        return this.companyAddress;
    }
    
    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }
    
    @Column(name="company_legal", length=64)
    public String getCompanyLegal() {
        return this.companyLegal;
    }
    
    public void setCompanyLegal(String companyLegal) {
        this.companyLegal = companyLegal;
    }
    
    @Column(name="company_type", length=2)
    public String getCompanyType() {
        return this.companyType;
    }
    
    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }
    
    @Column(name="contact_man", length=32)
    public String getContactMan() {
        return this.contactMan;
    }
    
    public void setContactMan(String contactMan) {
        this.contactMan = contactMan;
    }
    
    @Column(name="telephone", length=15)
    public String getTelephone() {
        return this.telephone;
    }
    
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    
    @Column(name="email", length=32)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="fax", length=18)
    public String getFax() {
        return this.fax;
    }
    
    public void setFax(String fax) {
        this.fax = fax;
    }
    
    @Column(name="login_url", length=128)
    public String getLoginUrl() {
        return this.loginUrl;
    }
    
    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }
    
    @Column(name="index_logo", length=256)
    public String getIndexLogo() {
        return this.indexLogo;
    }
    
    public void setIndexLogo(String indexLogo) {
        this.indexLogo = indexLogo;
    }
    
    @Column(name="index_pictrue", length=256)
    public String getIndexPictrue() {
        return this.indexPictrue;
    }
    
    public void setIndexPictrue(String indexPictrue) {
        this.indexPictrue = indexPictrue;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="create_date", length=19)
    public Date getCreateDate() {
        return this.createDate;
    }
    
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    
    @Column(name="create_man", length=32)
    public String getCreateMan() {
        return this.createMan;
    }
    
    public void setCreateMan(String createMan) {
        this.createMan = createMan;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="modify_date", length=19)
    public Date getModifyDate() {
        return this.modifyDate;
    }
    
    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }
    
    @Column(name="modify_man", length=32)
    public String getModifyMan() {
        return this.modifyMan;
    }
    
    public void setModifyMan(String modifyMan) {
        this.modifyMan = modifyMan;
    }
    
    @Column(name="status", length=1)
    public String getStatus() {
        return this.status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    @Column(name="have_child_company", length=2)
    public String getHaveChildCompany() {
        return this.haveChildCompany;
    }
    
    public void setHaveChildCompany(String haveChildCompany) {
        this.haveChildCompany = haveChildCompany;
    }
    
    @Column(name="display_order")
    public Integer getDisplayOrder() {
        return this.displayOrder;
    }
    
    public void setDisplayOrder(Integer displayOrder) {
        this.displayOrder = displayOrder;
    }
    
    @Column(name="del_flag", length=1)
    public String getDelFlag() {
        return this.delFlag;
    }
    
    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }
    
    @Column(name="vitrue_flag", length=1)
    public String getVitrueFlag() {
		return vitrueFlag;
	}


	public void setVitrueFlag(String vitrueFlag) {
		this.vitrueFlag = vitrueFlag;
	}

	@Column(name="org_flag", length=1)
	public String getOrgFlag() {
		return orgFlag;
	}


	public void setOrgFlag(String orgFlag) {
		this.orgFlag = orgFlag;
	}
	
	@Column(name="org_from", length=1)
    public String getOrgFrom() {
        return this.orgFrom;
    }
    
    public void setOrgFrom(String orgFrom) {
        this.orgFrom = orgFrom;
    }
    
    @Column(name="sync_flag", length=1)
    public String getSyncFlag() {
        return this.syncFlag;
    }
    
    public void setSyncFlag(String syncFlag) {
        this.syncFlag = syncFlag;
    }
    
    @Column(name="users_limit")
    public Integer getUsersLimit() {
        return this.usersLimit;
    }
    
    public void setUsersLimit(Integer usersLimit) {
        this.usersLimit = usersLimit;
    }
    
    @Column(name="user_limit_flag", length=1)
    public String getUserLimitFlag() {
        return this.userLimitFlag;
    }
    
    public void setUserLimitFlag(String userLimitFlag) {
        this.userLimitFlag = userLimitFlag;
    }
    
    @Column(name="other_net_flag", length=1)
    public String getOtherNetFlag() {
        return this.otherNetFlag;
    }
    
    public void setOtherNetFlag(String otherNetFlag) {
        this.otherNetFlag = otherNetFlag;
    }
    

    @Column(name="company_users_limit")
	public Integer getCompanyUsersLimit() {
		return companyUsersLimit;
	}
	public void setCompanyUsersLimit(Integer companyUsersLimit) {
		this.companyUsersLimit = companyUsersLimit;
	}

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY,mappedBy="company")
    public Set<SystemUser> getSystemUsers() {
        return this.systemUsers;
    }
    
    public void setSystemUsers(Set<SystemUser> systemUsers) {
        this.systemUsers = systemUsers;
    }
    
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    public Set<Department> getDepartments() {
        return this.departments;
    }
    
    public void setDepartments(Set<Department> departments) {
        this.departments = departments;
    }
    
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    public Set<Role> getRoles() {
        return this.roles;
    }
    
    public void setRoles(Set<Role> roles) {
        this.roles = roles;
    }
    
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    public Set<Menu> getMenus() {
        return this.menus;
    }
    
    public void setMenus(Set<Menu> menus) {
        this.menus = menus;
    }
}


